﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity.Migrations;
using System.Data.Entity;
using Csharp_manytomany_415.Data.Models;

namespace Csharp_manytomany_415.Data
{
    public static class Seeder
    {
        public static void Seed(MoviesDbContext db) 
        {
            db.Actors.AddOrUpdate(
                a => a.ActorId,
                new Actor() { ActorId = 1, FirstName = "Bruce", LastName = "Lee", City = "LosAngelas" },
                new Actor() { ActorId = 2, FirstName = "Bruce", LastName = "Willis", City = "Topeka" },
                new Actor() { ActorId = 3, FirstName = "Liam", LastName = "Neason", City = "Louisville" }

                );
            db.Movies.AddOrUpdate(
                m => m.MovieId,
                new Movie() { MovieId = 1, Title = "Fast and Furious"},
                new Movie() { MovieId = 2, Title = "Cinderella"},
                new Movie() { MovieId = 3, Title = "Alladin"}
                );
            db.MovieActor.AddOrUpdate(
                l => l.MovieActorId,
                new MovieActor() { MovieActorId = 1, MovieId = 1, ActorId = 1},
                new MovieActor() { MovieActorId = 2, MovieId = 1, ActorId = 2},
                new MovieActor() { MovieActorId = 3, MovieId = 2, ActorId = 3},
                new MovieActor() { MovieActorId = 4, MovieId = 3, ActorId = 1},
                new MovieActor() { MovieActorId = 5, MovieId = 3, ActorId = 2}
                );


            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
        
        }

    }
}
